/************************************************************************

								Heroes IV
					  Copyright 2000, The 3DO Company

	------------------------------------------------------------------
  						       mage_guild_window.h

	$Header: /game/mage_guild_window.h $

	$NoKeywords: $

 ************************************************************************/

#ifndef MAGE_GUILD_WINDOW_H_INCLUDED
#define MAGE_GUILD_WINDOW_H_INCLUDED

#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000

// kill the 255+ character identifier warning.  Templates tend to exceed that easily.
#pragma warning( disable: 4786 )

#include <vector>
#include "bitmap_group_ptr.h"
#include "bitmap_layer_ptr.h"
#include "game_window.h"

class t_army;
class t_bitmap_layer_cache_window;
class t_bitmap_layer_window;
class t_blended_bitmap_window;
class t_button;
class t_creature_array;
class t_hero;
enum  t_spell;
class t_spell_icon_window;
class t_text_window;
class t_town;
// -------------------------------------------------------------------
// window to display spells available in mage guild
// -------------------------------------------------------------------
class t_mage_guild_window : public t_window
{
public:
	t_mage_guild_window( t_town const* town, t_army const* adjacent_army, t_window* parent );
protected:
	enum { k_hero_icon_count = 5 };

	struct t_hero_info
	{
		t_window*                    frame;
		t_bitmap_layer_cache_window* icon;
		t_text_window*               text;
	};

	void close_click( t_button* );
	void create_buttons( t_screen_point book_origin );
	void create_detail_page();
	void create_labels();
	void create_hero_icons();
	void create_spell_icons();
	void index_click( t_button* );
	void last_hero_click( t_button* );
	void last_page_click( t_button* );
	void last_spell_click( t_button *);
	void next_hero_click( t_button* );
	void next_page_click( t_button* );
	void next_spell_click( t_button *);
	void scroll_hero_list( int first );
	void set_hero_list( t_creature_array const& creatures );
	void change_spell_set_visibility( bool visible );
	void spell_click( t_button*, t_spell spell );

	t_army const*           m_adjacent_army;
	t_bitmap_group_ptr		m_background_bitmaps;
	t_bitmap_group_ptr		m_book_bitmaps;
	int						m_current_page;
	t_spell					m_current_spell;
	t_window*				m_detail_window;
	t_bitmap_group_ptr		m_frame_bitmaps;
	t_hero_info				m_hero_frames[k_hero_icon_count];
	t_window*				m_index_window;
	t_bitmap_layer_ptr       m_large_spell_icon;
	t_blended_bitmap_window* m_large_spell_icon_window;
	t_button*				m_last_hero_button;
	t_button*				m_last_page_button;
	t_button*				m_last_spell_button;
	int						m_maximum_description_height;
	t_button*				m_next_hero_button;
	t_button*				m_next_page_button;
	t_button*				m_next_spell_button;
	t_spell_icon_window*	m_spell_icon;
	t_bitmap_layer_window*	m_spell_frame;
	t_bitmap_layer_window*  m_spell_name_banner;
	t_text_window*			m_spell_name;
	t_text_window*			m_spell_text;
	t_text_window*			m_spell_comment;
	std::vector<t_spell>    m_spells;
	t_town const*			m_town;
	std::vector<t_hero const*> m_heroes;
	int                        m_first_hero;
	t_window_list			m_icon_list[2];
	t_window_list			m_spellname_list[2];
	t_window_list			m_label_list[2];
	t_window_list			m_level_banner_list[2];
	t_window_list			m_label_banner_list[2];
	t_window_list			m_frames_list[2];
};

#endif // MAGE_GUILD_WINDOW_H_INCLUDED